<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="navbar.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'idea.jsp' starting page</title>
	<link rel="stylesheet" type="text/css" href="styles/css/bootstrap.min.css" />
	
	 
  </head>
  
  <body class="body">
    <div class="container" style="margin-top:60px;width:960px;margin-left:auto;margin-right:auto;">

	  <div class="row">
		
		
		<!-- 导入左侧部分 -->
		<jsp:include page="side.jsp">
			<jsp:param value="idea" name="tag"/>
		</jsp:include>
	
	
		<div class="span9">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
				<li class="active">

					<a href="idea.jspx"><i class="icon-fire"></i>想法</a> &nbsp;&nbsp;
					
					
					
				</li>
				<li class="pull-right"><i class="icon-plus"></i><a href="idea.jspx?m=new_idea" class="link-black">发表想法</a></li>
				<li class="pull-right">
						<a href="idea.jspx?m=myidea"><i class="icon-fire"></i>关于我的想法</a> &nbsp;&nbsp;	
				</li>
				
			
			</ul>
			<div class="wall" style="margin-bottom:20px; border:1px solid #ddd;padding:15px">
				
				<c:forEach items="${idealist.result }" var="idea">
					<blockquote>
					
					  <h4><a href="idea.jspx?m=idea_show&id=${idea.ideaId }">${idea.ideaName}</a></h4>
	
					  <p style="font-size:14px;line-height:1.5;">${idea.desc }</p>
					  <small>${idea.user.nickName }发布于 ${idea.time }</small>
					 
					  
					  <c:if test="${idea.time=='刚刚' ||idea.time=='10分钟之内'}">
					  
					  	<c:if test="${sessionScope.user.nickName==idea.user.nickName}">
					  		
					  		
					  			<a href="idea.jspx?m=edit_idea&id=${idea.ideaId }" title="编辑"><i class="icon-pencil"></i></a>
							  	<a href="idea.jspx?m=delidea&id=${idea.ideaId }" title="删除"><i class="icon-trash"></i></a>
					  			<c:choose>
					  				<c:when test="${param.code==10003 }">
					  					<span>该想法已有人评论，不能进行删除!</span>
					  				</c:when>
					  				<c:when test="${param.code==10004 }">
					  					<span>该想法已有人评论，不能进行编辑!</span>
					  				</c:when>
					  			
					  			</c:choose>
					  			
					  			
							  	
					  	</c:if>
					  </c:if>
					  
					  ${requestScope.msg }
					</blockquote>
				</c:forEach>
				
				
						<div class="pagination pagination-right">
					   	<c:choose>
					   		<c:when test="${idealist.pageNum==1 }">
					   			<li><a href="#">首页</a></li>
					   		</c:when>
					   		<c:otherwise>
					   			<li><a href="idea.jspx?p=1">首页</a></li>
					   		</c:otherwise>
					   	</c:choose>
					   	
					   	<c:choose>
					   		<c:when test="${idealist.pageNum==1 }">
					   			<li><a href="#">上一页</a></li>
					   		</c:when>
					   		<c:otherwise>
					   			<li><a href="idea.jspx?p=${idealist.pageNum -1}">上一页</a></li>
					   		</c:otherwise>
					   	</c:choose>
					   	<c:choose>
					   		<c:when test="${idealist.pageNum==idealist.totalPages }">
					   			<li><a href="#">下一页</a></li>
					   		</c:when>
					   		<c:otherwise>
					   			<li><a href="idea.jspx?p=${idealist.pageNum +1}">下一页</a></li>
					   		</c:otherwise>
					   	</c:choose>
					    
					    <c:choose>
					    	<c:when test="${idealist.pageNum==idealist.totalPages }">
					    		<li><a href="#">尾页</a></li>
					    	</c:when>
					    	<c:otherwise>
					    		<li><a href="idea.jspx?p=${idealist.totalPages }">尾页</a></li>
					    	</c:otherwise>
					    </c:choose>
						</div>
						
				
				
				
				
				
				<div class="pagination pull-right">
				  
				</div>
				
				<div class="clear"></div>
			</div>
		</div>
	  </div>
	</div>
  </body>
</html>
